<template>
  <!-- 交易流水 -->
  <div class="app-page">
    <el-tabs
      ref="cashierLedgerTab"
      v-model="activeTabName"
      type="card"
    >
      <el-tab-pane v-if="$hasTabPermission(90701)" label="实时收银台账" name="realTimeCashier">
        <realTimeCashier v-if="activeTabName === 'realTimeCashier'" ref="realTimeCashier" />
      </el-tab-pane>
      <el-tab-pane v-if="$hasTabPermission(90702)" label="实时回执台账" name="realTimeReceipt">
        <realTimeReceipt v-if="activeTabName === 'realTimeReceipt'" ref="realTimeReceipt" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import realTimeCashier from './components/realTimeCashier'
  import realTimeReceipt from './components/realTimeReceipt'
  export default {
    name: 'cashierLedger',
    components: {
      realTimeCashier, realTimeReceipt
    },
    data() {
      return {
        activeTabName: 'realTimeCashier'
      }
    },
    mounted() {
      this.activeTabName = this.$refs.cashierLedgerTab.panes[0].name
    }
  }
</script>
<style lang="scss" scoped>
  .app-page {
    padding: 0;
    margin: 0;
    /deep/.el-tabs__header {
      margin: 0 0 10px;
    }
  }
</style>
